package view;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
import view.admin.AdminCreateUser;
import view.admin.AdminDeleteUser;
import view.admin.AdminEditUser;
import view.admin.AdminLogin;
import view.admin.AdminMenu;
import view.admin.AdminStatistics;

import controller.KeyHandler;
import controller.TableHandler;
import controller.ActionEvents.ActionHandler;


public class AdminPanel extends JPanel {

	
	private CardLayout cl_adminContentPane;
	private ActionHandler ah;
	
	private AdminLogin adminLogin;
	private AdminMenu adminMenu;
	private AdminCreateUser adminCreateUser;
	private AdminDeleteUser adminDeleteUser;
	private AdminStatistics adminStatistics;
	private AdminEditUser adminEditUser;

	
	/**
	 * Create the panel.
	 */
	public AdminPanel(ActionHandler ah, TableHandler ml, KeyHandler kh) {
		
		setPreferredSize(new Dimension(750,500));
		setLayout(new CardLayout(0, 0));
		setBackground(Color.decode("#56606a"));
		this.ah = ah;
		
		adminLogin = new AdminLogin(ah);
		add(adminLogin, "ADMINLOGIN");
		
		adminMenu = new AdminMenu(ah);
		add(adminMenu, "ADMINMENU");
		
		adminCreateUser = new AdminCreateUser(ah, kh);
		add(adminCreateUser, "ADMINCREATEUSER");
		
		adminDeleteUser = new AdminDeleteUser(ah);
		add(adminDeleteUser, "ADMINDELETEUSER");
		
		adminStatistics = new AdminStatistics(ah);
		add(adminStatistics, "ADMINSTATISTICS");
		
		adminEditUser = new AdminEditUser(ah, ml);
		add(adminEditUser, "ADMINEDITUSER");
		
		cl_adminContentPane = (CardLayout) getLayout();
	}
	public void show(String card) 
	{
		cl_adminContentPane.show(this,card);
	}
	/**
	 * @return the adminLogin
	 */
	public AdminLogin getAdminLogin() {
		return adminLogin;
	}
	/**
	 * @param adminLogin the adminLogin to set
	 */
	public void setAdminLogin(AdminLogin adminLogin) {
		this.adminLogin = adminLogin;
	}
	/**
	 * @return the adminCreateUser
	 */
	public AdminCreateUser getAdminCreateUser() {
		return adminCreateUser;
	}
	/**
	 * @return the adminMenu
	 */
	public AdminMenu getAdminMenu() {
		return adminMenu;
	}
	/**
	 * @param adminMenu the adminMenu to set
	 */
	public void setAdminMenu(AdminMenu adminMenu) {
		this.adminMenu = adminMenu;
	}
	/**
	 * @return the adminDeleteUser
	 */
	public AdminDeleteUser getAdminDeleteUser() {
		return adminDeleteUser;
	}
	/**
	 * @param adminDeleteUser the adminDeleteUser to set
	 */
	public void setAdminDeleteUser(AdminDeleteUser adminDeleteUser) {
		this.adminDeleteUser = adminDeleteUser;
	}
	/**
	 * @return the adminStatistics
	 */
	public AdminStatistics getAdminStatistics() {
		return adminStatistics;
	}
	/**
	 * @param adminStatistics the adminStatistics to set
	 */
	public void setAdminStatistics(AdminStatistics adminStatistics) {
		this.adminStatistics = adminStatistics;
	}
	/**
	 * @return the adminEditUser
	 */
	public AdminEditUser getAdminEditUser() {
		return adminEditUser;
	}
	/**
	 * @param adminEditUser the adminEditUser to set
	 */
	public void setAdminEditUser(AdminEditUser adminEditUser) {
		this.adminEditUser = adminEditUser;
	}
	/**
	 * @param adminCreateUser the adminCreateUser to set
	 */
	public void setAdminCreateUser(AdminCreateUser adminCreateUser) {
		this.adminCreateUser = adminCreateUser;
	}

}
